/*
 * BuilderController.h
 *
 *  Created on: Jul 1, 2010
 *      Author: Ry
 */

#ifndef BUILDERCONTROLLER_H_
#define BUILDERCONTROLLER_H_

#include <vector>
#include <SDL/SDL_events.h>
#include <event/SDLEventHandler.h>
#include <math/Plane.h>
#include <world/SimpleWorld.h>

#include "BuilderMotionController.h"

class BuilderController: public SDLEventHandler {
private:
	Object *player;
	Object *building;
	SimpleWorld *world;
	std::vector<Mesh*> buildingMeshes;
	unsigned int buildingIndex;

	BuilderMotionController *motionController;
	bool rotating;

	SDLKey moveForward;
	SDLKey moveBackward;
	SDLKey strafeLeft;
	SDLKey strafeRight;

	Vector3 buildPosition;
	Plane ground;
public:
	BuilderController(Object *player, SimpleWorld *world, std::vector<Mesh*> buildingMeshes);
	void handleEvent(float dts);
	MotionController* getMotionController();
	virtual ~BuilderController();
};

#endif /* BUILDERCONTROLLER_H_ */
